import { FC } from "react";
import { RootState } from 'store/reducer'
import { useStore } from "react-redux";
import { ArticleContent } from '../components/artcileContent'
import { useParams } from "react-router";

interface Props {
    id: string,
}

export const Article: FC = () => {
    const route = useParams<Props>();
    const store = useStore<RootState>();
    const article = store.getState().article;
    return (
        <div>
            <h2>{article.title}</h2>
            <ArticleContent content={article.content}></ArticleContent>
        </div>
    );
}